﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.mdx;

namespace SharpSqlAnalyzer.stmt.mdx
{
	// Token: 0x0200019A RID: 410
	public class TMdxDrillthrough : TCustomSqlStatement
	{
		// Token: 0x06000E20 RID: 3616 RVA: 0x003097CE File Offset: 0x003079CE
		public TMdxDrillthrough(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstmdxdrillthrough;
		}

		// Token: 0x06000E21 RID: 3617 RVA: 0x003097E4 File Offset: 0x003079E4
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			this.drillthroughNode = (TMdxDrillthroughNode)this.rootNode;
			this.subQuery = new TMdxSelect(EDbVendor.dbvmdx);
			this.subQuery.rootNode = this.drillthroughNode.SelectNode;
			this.subQuery.doParseStatement(this);
			return 0;
		}

		// Token: 0x17000292 RID: 658
		// (get) Token: 0x06000E22 RID: 3618 RVA: 0x00309845 File Offset: 0x00307A45
		public virtual TMdxSelect SubQuery
		{
			get
			{
				return this.subQuery;
			}
		}

		// Token: 0x17000293 RID: 659
		// (get) Token: 0x06000E23 RID: 3619 RVA: 0x0030984D File Offset: 0x00307A4D
		public virtual List<TMdxExpNode> ReturnAttrs
		{
			get
			{
				return this.drillthroughNode.ReturnAttrs;
			}
		}

		// Token: 0x06000E24 RID: 3620 RVA: 0x0030985A File Offset: 0x00307A5A
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000E25 RID: 3621 RVA: 0x0030986C File Offset: 0x00307A6C
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.subQuery.accept(v);
			if (this.ReturnAttrs != null)
			{
				foreach (TMdxExpNode tmdxExpNode in this.ReturnAttrs)
				{
					tmdxExpNode.acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x04001327 RID: 4903
		private TMdxDrillthroughNode drillthroughNode;

		// Token: 0x04001328 RID: 4904
		private TMdxSelect subQuery;
	}
}
